package com.fenghongzhang.a18103.adapter;

import android.content.Context;
import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.fenghongzhang.a18103.R;
import com.fenghongzhang.a18103.entity.Food;

import java.util.List;

public class FoodAdapter2 extends BaseQuickAdapter<Food.DataBean, BaseViewHolder> {


    private Context context;

    public FoodAdapter2(int layoutResId, @Nullable List<Food.DataBean> data,Context context) {
        super(layoutResId, data);

        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, Food.DataBean item) {
        helper.setText(R.id.rv_title,item.getTitle());
        Glide.with(context).load(item.getPic()).into((ImageView) helper.getView(R.id.rv_img));

    }
}
